function  change_image(image_id,id,type)
{

	var value = 0;
	if($('#'+image_id).attr("src") == '/wondershare/images/yes.gif')
	{
		$('#'+image_id).attr("src","/wondershare/images/no.gif"); 
	
	}else
	{
		value = 1;
		$('#'+image_id).attr("src","/wondershare/images/yes.gif");  
	}
	
	if(type == 'comment_show')
	{
		$.get("/wondershare/comment.php?action=index", { in_jax: 1, comment_id: id,value:value,type:'show', product_id:$('#product_id').val()},
		function(data){
			
			});
	}
}
	
function  check_css(sort_tag,type)
{
	if(type==1)
	{
		$("#"+sort_tag).css({  "background": "blue","color": "#ff0011"}); 
	}
	else
	{
		$("#"+sort_tag).css({ "background": "","color":""}); 
	}

}

function  check_info(id,check_tag,td_check_id,length,type)
{
	value = ($('#'+check_tag).html());
	value = value.replace(/"/g,'&quot;');
	$("#"+check_tag).remove();
	$("#"+td_check_id).html('<input type="text" id="'+check_tag+'"  value="'+value+'"   style="width:'+length+'px" />');
	$("#"+check_tag).focus();
	$("#"+check_tag).blur( function ()
	{ 
				  
		var check_value = $('#'+check_tag).val();		
		
		if(type == 'comment_sort')
		{
			check_value = parseInt(check_value);
		}	
	
		var str ="<span   id='"+check_tag+"' >"+check_value+"</span>";
		
		$("#"+td_check_id).html("");
		$("#"+td_check_id).html(str);
		
		$("#"+check_tag).mouseout( function () { check_css(check_tag,0); }); 
		$("#"+check_tag).mouseover( function () { check_css(check_tag,1); }); 
		
		$("#"+check_tag).click( function () { check_info(id,check_tag,td_check_id,length,type); }); 
	
		if(type=='comment_sort')
		{
			$.get("/wondershare/comment.php?action=index", { in_jax: 1, comment_id: id,value:check_value,type:'sort' },
			function(data){});  
		}					
	});
}

function  delete_comment(ar_id,type,act_type)
{
	var str = "";
	var falge = false;
	if(type == 'list')
	{
		if($('#action').attr('checked'))
		{
			$('input[name="ID[]"]').each(function () {
				if ($(this).attr('checked')) 
				{
					falge = true;
					str += $(this).val() + ",";
					$("#tr_"+$(this).val()).remove();
					$('#total').html(parseInt($('#total').html())-1) ;
				}
			});
			if(!falge)
			{
				alert('你没有选择任何选项！');   
			}
		}else
		{
			alert('你没有选择删除！');
		}
	}else
	{
		str = ar_id+','; 
		$("#tr_"+ar_id).remove();
		$('#total').html(parseInt($('#total').html())-1) ;
	}
	if(act_type == 'comment')
	{
		$.get("/wondershare/comment.php?action=del", {checkList: str },
		function(data){}); 
	}

}









